<?php
	error_reporting(E_ALL^E_NOTICE);
    require_once ('../config/config.php'); 
	require_once ('../config/email.class.php'); 
	session_start();
	if($_GET['ops']=="logout"){
	    //session_destroy();
	    unset($_SESSION['member']);
	    echo "<script>alert('成功退出！');location='./index.php';</script>";
	}
	if(empty($_SESSION['member'])){
		echo "<script>alert('登陆后可查看详情！');location='./index.php';</script>";
	}
	if($_GET['id']==""){
		echo "<script>location='./index.php';</script>";
	}else{
		$contentRs=mysqli_fetch_array(mysqli_query($con,"select * from content where id='".$_GET['id']."'"));
		if($contentRs['id']==""){
			echo "<script>location='./index.php';</script>";
		}elseif($contentRs['state']!="1"){
			echo "<script>location='./index.php';</script>";
		}else{
			$ViewsRs=mysqli_fetch_array(mysqli_query($con,"select * from content where id='".$_GET['id']."'"));
			$Views=$ViewsRs['Views']+1;
			mysqli_query($con,"update content set Views='".$Views."' where id='".$_GET['id']."'");
		}
	}
	if($_GET['ops']=="like" && $_GET['id'] &&!empty($_SESSION['member'])){
		$likeRs=mysqli_fetch_array(mysqli_query($con,"select * from content where id='".$_GET['id']."'"));
		$nol=$likeRs['nol']+1;
		mysqli_query($con,"update content set nol='".$nol."' where id='".$_GET['id']."'");
		
	}
	if($_GET['ops']=="comment" && $_GET['id'] && !empty($_SESSION['member'])){
		if($_POST['comment']==""){
			echo "<script>alert('评论不能为空！');location='./job.php?id=".$contentRs['id']."';</script>";
		}else{
			mysqli_query($con,"insert into comment values('','".$_SESSION['member']."','".$_POST['comment']."','".$_GET['id']."','".date("Y/m/d H:i:s")."','".getip()."')");
			echo "<script>alert('评论成功！');location='./job.php?id=".$contentRs['id']."';</script>";
		}
	}
	if($_GET['ops']=="get"){
	    $jobRs=mysqli_fetch_array(mysqli_query($con,"select * from job where user='".$_SESSION['member']."' and id='".$_GET['id']."'"));
		$businessRs=mysqli_fetch_array(mysqli_query($con,"select * from member where user='".$contentRs['addUser']."'"));
	    $rusumeRs=mysqli_fetch_array(mysqli_query($con,"select * from resume where user='".$_SESSION['member']."'"));
	    if($jobRs['user']==$_SESSION['member']){
	         mysqli_query($con,"update job set secretKey='".$rusumeRs['secretKey']."' where user='".$_SESSION['member']."' and id='".$_GET['id']."'");
			$smtpserver = "smtp.mxhichina.com";//SMTP服务器
			$smtpserverport ="25";//SMTP服务器端口
			$smtpusermail = "yhl@geeklife.top";//SMTP服务器的用户邮箱
			$smtpemailto = $businessRs['email'];//发送给谁
			$smtpuser = "yhl@geeklife.top";//SMTP服务器的用户帐号
			$smtppass = "Yhl12345";//SMTP服务器的用户密码
			$mailsubject = "【校园兼职网站】-用户简历投递";//邮件主题
			$mail = new StdClass;
			$mail->FromName = "【校园兼职网站】";
			$mailbody = "<div backgroud='seashell' id='contentDiv' onmouseover='getTop().stopPropagation(event);' onclick='getTop().preSwapLink(event, 'html', 'ZC2306-nkpgO9wi6NnbD1EOMO2hGa7');' style='position:relative;font-size:14px;height:auto;padding:15px 15px 10px 15px;z-index:1;zoom:1;line-height:1.7;' class='body'><div id='qm_con_body'><div id='mailContentContainer' class='qmbox qm_con_body_content qqmail_webmail_only'><div style='width:700px;background-color:#fff;margin:0 auto;border: 1px solid #ccc;'><div style='height:64px;margin:0;padding:0;width:100%;'><a href='http://yhl.165800.xyz' style='display:block;padding: 12px 30px;text-decoration: none;font-size: 24px;letter-spacing: 3px;border-bottom: 1px solid #ccc;' rel='noopener' target='_blank'> 校园兼职网站 </a></div><div style='padding: 30px;margin:0;'><p style='font-size:14px;color:#333;'> 尊敬的商家，有用户更新了简历，请注意上线查看！ </p><p style='font-size:14px;color: #999;'>— 校园兼职网站</p><p style='font-size:12px;color:#999;border-top:1px dotted #E3E3E3;margin-top:30px;padding-top:30px;'> 本邮件为系统邮件，请勿回复。 </p></div></div><style type='text/css'>.qmbox style, .qmbox script, .qmbox head, .qmbox link, .qmbox meta {display: none !important;}</style></div></div><style>#mailContentContainer .txt {height:auto;}</style></div>";//邮件内容
			$mailtype = "HTML";//邮件格式（HTML/TXT）,TXT为文本邮件
			$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//这里面的一个true是表示使用身份验证,否则不使用身份验证.
			$smtp->debug = false;//是否显示发送的调试信息
			$av=$smtp->sendmail($smtpemailto,$smtpusermail, $mailsubject,$mailbody,$mailtype);
	         echo "<script>alert('您已成功修改简历！');location='./job.php?id=".$_GET['id']."';</script>";
	    }else{
	        mysqli_query($con,"insert into job values('','".$_SESSION['member']."','".$_GET['id']."','".$rusumeRs['id']."','".$rusumeRs['secretKey']."','".date("Y/m/d H:i:s")."','','','0')");
	        $smtpserver = "smtp.mxhichina.com";//SMTP服务器
			$smtpserverport ="25";//SMTP服务器端口
			$smtpusermail = "yhl@geeklife.top";//SMTP服务器的用户邮箱
			$smtpemailto = $businessRs['email'];//发送给谁
			$smtpuser = "yhl@geeklife.top";//SMTP服务器的用户帐号
			$smtppass = "Yhl12345";//SMTP服务器的用户密码
			$mailsubject = "【校园兼职网站】-用户简历投递";//邮件主题
			$mail = new StdClass;
			$mail->FromName = "【校园兼职网站】";
			$mailbody = "<div backgroud='seashell' id='contentDiv' onmouseover='getTop().stopPropagation(event);' onclick='getTop().preSwapLink(event, 'html', 'ZC2306-nkpgO9wi6NnbD1EOMO2hGa7');' style='position:relative;font-size:14px;height:auto;padding:15px 15px 10px 15px;z-index:1;zoom:1;line-height:1.7;' class='body'><div id='qm_con_body'><div id='mailContentContainer' class='qmbox qm_con_body_content qqmail_webmail_only'><div style='width:700px;background-color:#fff;margin:0 auto;border: 1px solid #ccc;'><div style='height:64px;margin:0;padding:0;width:100%;'><a href='http://yhl.165800.xyz' style='display:block;padding: 12px 30px;text-decoration: none;font-size: 24px;letter-spacing: 3px;border-bottom: 1px solid #ccc;' rel='noopener' target='_blank'> 校园兼职网站 </a></div><div style='padding: 30px;margin:0;'><p style='font-size:14px;color:#333;'> 尊敬的商家，您发布的兼职信息收到新的简历，请注意上线查看！ </p><p style='font-size:14px;color: #999;'>— 校园兼职网站</p><p style='font-size:12px;color:#999;border-top:1px dotted #E3E3E3;margin-top:30px;padding-top:30px;'> 本邮件为系统邮件，请勿回复。 </p></div></div><style type='text/css'>.qmbox style, .qmbox script, .qmbox head, .qmbox link, .qmbox meta {display: none !important;}</style></div></div><style>#mailContentContainer .txt {height:auto;}</style></div>";//邮件内容
			$mailtype = "HTML";//邮件格式（HTML/TXT）,TXT为文本邮件
			$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//这里面的一个true是表示使用身份验证,否则不使用身份验证.
			$smtp->debug = false;//是否显示发送的调试信息
			$av=$smtp->sendmail($smtpemailto,$smtpusermail, $mailsubject,$mailbody,$mailtype);
			echo "<script>alert('成功提交申请！');location='./job.php?id=".$_GET['id']."';</script>";
	    }
	}
?>
<html lang="zh-CN" class="translated-ltr"><head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

	<!-- CSS -->
	<link rel="stylesheet" href="css/bootstrap-reboot.min.css">
	<link rel="stylesheet" href="css/bootstrap-grid.min.css">
	<link rel="stylesheet" href="css/owl.carousel.min.css">
	<link rel="stylesheet" href="css/nouislider.min.css">
	<link rel="stylesheet" href="css/select2.min.css">
	<link rel="stylesheet" href="css/jquery.mCustomScrollbar.min.css">
	<link rel="stylesheet" href="css/ionicons.min.css">
	<link rel="stylesheet" href="css/main.css">

	<!-- Favicons -->
	<link rel="icon" type="image/png" href="icon/favicon-32x32.png" sizes="32x32">
	<link rel="apple-touch-icon" href="icon/favicon-32x32.png">
	<link rel="apple-touch-icon" sizes="72x72" href="icon/apple-touch-icon-72x72.png">
	<link rel="apple-touch-icon" sizes="114x114" href="icon/apple-touch-icon-114x114.png">
	<link rel="apple-touch-icon" sizes="144x144" href="icon/apple-touch-icon-144x144.png">

	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="author" content="Dmitry Volkov">
	<title>校园兼职网站 - 兼职信息</title>
<link type="text/css" rel="stylesheet" charset="UTF-8" href="https://translate.googleapis.com/translate_static/css/translateelement.css"></head>

<body>
	<!-- header -->
	<header class="header">
		<div class="container">
			<div class="row">
				<div class="col-7 col-md-9 col-lg-8 col-xl-9">
					<div class="header__content">
						<!-- header menu btn -->
						<button class="header__btn" type="button">
							<span></span>
							<span></span>
							<span></span>
						</button>
						<!-- end header menu btn -->

						<!-- header logo -->
						<a href="index.php" class="header__logo">
							<b>校园兼职网站</b>
						</a>
						<!-- end header logo -->

						<!-- header nav -->
						<ul class="header__nav">
							<!-- dropdown -->
							<li class="header__nav-item">
								<a href="index.php" class="header__nav-link"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">首页</font></font></a>
							</li>
							<li class="header__nav-item">
								<a href="news.php" class="header__nav-link"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">新闻</font></font></a>
							</li
							<!-- end dropdown -->

							<!-- dropdown -->
							<li class="header__nav-item">
								<a class="dropdown-toggle header__nav-link" href="#" role="button" id="dropdownMenuProjects" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">分类</font></font></a>

								<ul class="dropdown-menu header__dropdown-menu" aria-labelledby="dropdownMenuProjects">
									<?php
										$result=mysqli_query($con,"select * from class order by id asc");
										while($rs=mysqli_fetch_array($result)){
									?>
											<li><a href="index.php?id=<?php echo $rs['id'];?>"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $rs['className'];?></font></font></a></li>
									<?php }?>
								</ul>
							</li>
							<!-- end dropdown -->

							<!-- dropdown -->
							<li class="header__nav-item">
								<a class="dropdown-toggle header__nav-link" href="#" role="button" id="dropdownMenuJobs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">商家服务</font></font></a>

								<ul class="dropdown-menu header__dropdown-menu" aria-labelledby="dropdownMenuJobs">
									<li><a href="add-job.php"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">发布工作</font></font></a></li>
								</ul>
							</li>
							<!-- end dropdown -->

						</ul>
						<!-- end header nav -->

					</div>
				</div>

				<div class="col-5 col-md-3 col-lg-4 col-xl-3">
					<div class="header__content header__content--end">
						<div class="header__profile">
							<?php
								if(empty($_SESSION['member'])){?>
									<a href="./signin.php"  role="button" id="dropdownMenuProfile">
										<span>
											<font style="vertical-align: inherit;">
												<font style="vertical-align: inherit;">登录</font>
											</font>
										</span>
									</a>
							<?php
								}else{?>
									<a class="dropdown-toggle header__profile-btn" href="#"  role="button" id="dropdownMenuProfile" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
										<span>
											<font style="vertical-align: inherit;">
												<font style="vertical-align: inherit;">欢迎您，<?php echo $_SESSION['member'];?></font>
											</font>
										</span>
									</a>
									<ul class="dropdown-menu dropdown-menu-right header__dropdown-menu header__dropdown-menu--right" aria-labelledby="dropdownMenuProfile">
									<li><a href="./company.php"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">个人信息</font></font></a></li>
										<li><a href="./complaints-list.php"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">投诉记录</font></font></a></li>
										<li><a href="../master/login.php"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">后台管理</font></font></a></li>
										<li><a href="./resume.php"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">我的简历</font></font></a></li>
										<li><a href="?ops=logout"><i class="icon ion-ios-exit"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">登出</font></font></a></li>
									</ul>
							<?php
								}
							?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</header>
	<!-- end header -->

	<!-- main content -->
	<main class="main main--breadcrumb">
		<!-- breadcrumb -->
		<div class="breadcrumb">
			<div class="container">
				<div class="row">
					<div class="col-12">
						<ul class="breadcrumb__wrap">
							<li class="breadcrumb__item"><a href="./index.php"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">首页</font></font></a></li>
							<li class="breadcrumb__item breadcrumb__item--active"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $contentRs['title'];?></font></font></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<!-- end breadcrumb -->

		<div class="container">
			<div class="row">
				<div class="col-12 col-md-7 col-lg-8 col-xl-9">
					<!-- post -->
					<div class="post">
						<div class="post__head">
							<div class="post__head-title">
								<h5><a href="#"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $contentRs['addUser'];?></font></font></a></h5>
								<p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $contentRs['addTime'];?></font></font></p>
							</div>
						</div>

						<div class="post__wrap">
							<div class="post__location">
								<i class="icon ion-ios-navigate"></i>
								<span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $contentRs['address'];?></font></font></span>
							</div>
						</div>

						<h2 class="post__title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $contentRs['title'];?></font></font></h2>

						<div class="post__options">
							<span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php if($contentRs['type']=="1"){echo "长期";}elseif($contentRs['type']=="2"){echo "短期";}?></font></font></span>
							<p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">￥ <?php echo $contentRs['salary'];?> /小时</font></font></p>
						</div>

						<div class="form__group">
							<?php echo $contentRs['more'];?>
						</div>

						<div class="post__tags">
									分类所属：<a href="#">
												<font style="vertical-align: inherit;">
													<font style="vertical-align: inherit;">
														<?php
															$classRs=mysqli_fetch_array(mysqli_query($con,"select * from class where id='".$contentRs['classId']."'"));
															echo $classRs['className'];
														?>
													</font>
												</font>
											</a>
								</div>

						<a href="./complaints.php?id=<?php echo $contentRs['id'];?>" class="post__apply"><span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">投诉该兼职信息</font></font></span></a>

						<div class="post__stats">
							<div>
								<a class="post__likes" href="?ops=like&id=<?php echo $contentRs['id'];?>"><i class="icon ion-ios-heart"></i> <span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $contentRs['nol'];?></font></font></span></a>
								<a class="post__comments" data-toggle="collapse" href="#collapse1" role="button" aria-expanded="false" aria-controls="collapse1"><i class="icon ion-ios-text"></i> <span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
								<?php 
									$total=mysqli_num_rows(mysqli_query($con,"select * from comment where contentId='".$contentRs['id']."'"));
									echo $total;
								?>
								</font></font></span></a>
							</div>

							<div class="post__views">
								<i class="icon ion-ios-eye"></i> <span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><?php echo $contentRs['Views'];?></font></font></span>
							</div>
						</div>

						<div class="collapse post__collapse" id="collapse1">
							<br />
							<?php
								$commentResult=mysqli_query($con,"select * from comment where contentId='".$contentRs['id']."' order by id asc");
								while($commentRs=mysqli_fetch_array($commentResult)){
									echo "用户名：".$commentRs['user']."<br />评论：".$commentRs['more']."<br />评论时间：".$commentRs['addTime']."<hr />";
								}
							?>
							<form action="?ops=comment&id=<?php echo $contentRs['id'];?>" method="post" class="post__form">
								<input type="text" name="comment" placeholder="输入您的评论...">
								<button type="submit" name="submit"><i class="icon ion-ios-paper-plane"></i></button>
							</form>
						</div>
					</div>
					<!-- end post -->
				</div>

				<div class="col-12 col-md-5 col-lg-4 col-xl-3">
					<!-- apply btn -->
					<div class="sidebox">
						<div class="sidebox__apply">
							<a href="?ops=get&id=<?php echo $_GET['id'];?>"><button class="filter__btn" type="button"><span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">现在申请</font></font></span></button></a>
						</div>
					</div>
					<!-- end apply btn -->

					<!-- share -->
					<div class="sidebox">
						<div class="sidebox__share">
							<span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">分享：</font></font></span>
							<div class="bshare-custom"><a title="分享到QQ空间" class="bshare-qzone"></a><a title="分享到新浪微博" class="bshare-sinaminiblog"></a><a title="分享到人人网" class="bshare-renren"></a><a title="分享到腾讯微博" class="bshare-qqmb"></a><a title="分享到网易微博" class="bshare-neteasemb"></a><a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a><span class="BSHARE_COUNT bshare-share-count">0</span></div><script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=2&amp;lang=zh"></script><script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bshareC0.js"></script>
						</div>
					</div>
					<!-- end share -->

					<!-- sidebox -->
					<div class="sidebox sidebox--desk">
						<h4 class="sidebox__title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">最新十条兼职信息</font></font></h4>
						<div class="sidebox__content">
							<div class="sidebox__job">
								<?php
									$newResult=mysqli_query($con,"select * from content order by id desc");
									$count=1;
									while($newRs=mysqli_fetch_array($newResult)){
										if($newRs['state']=="1"){
											if($count<=10){
												$count=$count+1;
												echo "<div class='sidebox__job-title'>
												<a href='./job.php?id=".$newRs['id']."'><font style='vertical-align: inherit;'><font style='vertical-align: inherit;'>".$newRs['title']."</font></font></a>
												<span><font style='vertical-align: inherit;'><font style='vertical-align: inherit;'>￥ ".$newRs['salary']." /小时</font></font></span>
											</div>";
											}else{
												return;
											}
										}
									}
								?>
							</div>
						</div>
					</div>
					<!-- end sidebox -->
				</div>
			</div>
		</div>
	</main>
	<!-- end main content -->

	<!-- footer -->
	<footer class="footer">
		<div class="container">
			<div class="row">
				<div class="col-12">
					<div class="footer__content">
						<a href="index.php" class="footer__logo">
							校园兼职网站
						</a>

						<span class="footer__copyright"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">&copy;2022 <a href="http://www.huayu.edu.cn" target="_black">山东华宇工学院</a> SomeRights</font></font></span>

						<button class="footer__back" type="button">
							<i class="icon ion-ios-arrow-round-up"></i>
						</button>
					</div>
				</div>
			</div>
		</div>
	</footer>
	<!-- end footer -->

	<!-- JS -->
	<script src="js/jquery-3.4.1.min.js"></script>
	<script src="js/bootstrap.bundle.min.js"></script>
	<script src="js/owl.carousel.min.js"></script>
	<script src="js/wNumb.js"></script>
	<script src="js/nouislider.min.js"></script>
	<script src="js/select2.min.js"></script>
	<script src="js/jquery.mousewheel.min.js"></script>
	<script src="js/jquery.mCustomScrollbar.min.js"></script>
	<script src="js/main.js"></script><div id="goog-gt-tt" class="skiptranslate" dir="ltr"><div style="padding: 8px;"><div><div class="logo"><img src="https://www.gstatic.com/images/branding/product/1x/translate_24dp.png" width="20" height="20" alt="Google 翻译"></div></div></div><div class="top" style="padding: 8px; float: left; width: 100%;"><h1 class="title gray">原文</h1></div><div class="middle" style="padding: 8px;"><div class="original-text"></div></div><div class="bottom" style="padding: 8px;"><div class="activity-links"><span class="activity-link">提供更好的翻译建议</span><span class="activity-link"></span></div><div class="started-activity-container"><hr style="color: #CCC; background-color: #CCC; height: 1px; border: none;"><div class="activity-root"></div></div></div><div class="status-message" style="display: none;"></div></div>

<div class="goog-te-spinner-pos"><div class="goog-te-spinner-animation"><svg xmlns="http://www.w3.org/2000/svg" class="goog-te-spinner" width="96px" height="96px" viewBox="0 0 66 66"><circle class="goog-te-spinner-path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle></svg></div></div></body></html>